
from typing import List


def reorderLogFiles(logs: List[str]) -> List[str]:
    def trans(log : str) -> tuple:
        a,b = log.split(' ',1)
        return (0,b,a) if b[0].isalpha() else(1,)
    logs.sort(key=trans)
    return logs
logs = ["dig1 8 1 5 1", "let1 art can", "dig2 3 6", "let2 own kit dig", "let3 art zero"]  
print("result:",reorderLogFiles(logs))